//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.comprosoft.telnet.command;

import com.comprosoft.telnet.io.IOHandler;
import com.comprosoft.telnet.server.TelnetServer;
import java.util.logging.Level;
import java.util.logging.Logger;

public abstract class Command {
    private static final Logger logger = Logger.getLogger("TelnetServer");
    private final IOHandler io;
    private final String command;
    private final TelnetServer telnetServer;

    public Command(IOHandler io, String command, TelnetServer telnetServer) {
        this.io = io;
        this.command = command;
        this.telnetServer = telnetServer;
    }

    public TelnetServer getTelnetServer() {
        return this.telnetServer;
    }

    public IOHandler getIOHandler() {
        return this.io;
    }

    public static Logger getLogger() {
        return logger;
    }

    public static String[] tokenize(String input) {
        return input.split("\\s+");
    }

    public final CommandResult handle(String[] args) {
        logger.log(Level.INFO, "Running the following command: " + this.command);
        return this.handleCommand(args);
    }

    protected abstract CommandResult handleCommand(String[] var1);
}
